<template>
  <div class="mt-[-5px] flex h-[calc(100%-82px)] w-full">
    <div
      v-if="!isExpand"
      class="left relative z-10 flex h-full w-[20%] flex-col overflow-hidden"
    >
      <slot name="left"></slot>
    </div>
    <div class="center flex h-full flex-1 flex-col overflow-hidden pt-3">
      <div class="top w-full flex-1" :style="style">
        <slot name="centerTop"></slot>
      </div>
      <div class="bottom relative w-full">
        <slot name="centerBottom"></slot>
      </div>
    </div>
    <div v-if="!isExpand" class="right relative z-10 w-[20%]">
      <slot name="right"></slot>
    </div>
  </div>
</template>

<script setup lang="tsx">
import { CSSProperties, computed } from 'vue';
import { useRoute } from 'vue-router';

defineProps({
  isExpand: {
    type: Boolean,
    default: false,
  },
});

const route = useRoute();

const style = computed<CSSProperties>(() => {
  if (route.query.active !== '2') {
    return {
      position: 'relative',
    };
  }
  return {};
});
</script>

<style lang="scss" scoped></style>
